//
//  registerViewController.m
//  lagou
//
//  Created by mafeng on 16/7/15.
//  Copyright © 2016年 mafeng. All rights reserved.
//

#import "registerViewController.h"
#import "BottleView.h"
#import "FXBlurView.h"
@interface registerViewController ()
@property (nonatomic, strong) UIImageView *backgroundImageView;
@property (nonatomic, strong) UIImageView *logoImageView;
@property (nonatomic, strong) UITextField *phoneNumeberTextField;
@property (nonatomic, strong) UITextField *verificationCodeTextField;
@property (nonatomic, strong) UIButton *registerButton;
@property (nonatomic, strong) UIButton *returnButton;
@property (nonatomic, strong) UIImageView *phoneImageView;
@property (nonatomic, strong) UIImageView *verificationCodeImageView;

@end

@implementation registerViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    UIColor *color = [UIColor colorWithRed:0 / 255.0 green:180 / 255.0 blue:140 / 255.0 alpha:1.0];
#pragma mark -- 设置背景图
    self.backgroundImageView = [[UIImageView alloc] initWithFrame:self.view.frame];
    [self.backgroundImageView setImage:[UIImage imageNamed:@"welcome_2"]];
    [self.view addSubview:self.backgroundImageView];
#pragma mark -- 毛玻璃
    FXBlurView *fxView = [[FXBlurView alloc] initWithFrame:self.view.frame];
    fxView.dynamic = NO;
    fxView.blurRadius = 30;
    fxView.tintColor = [UIColor clearColor];
    [self.view addSubview:fxView];
#pragma mark -- 中间的logo
    self.logoImageView = [[UIImageView alloc] initWithFrame:CGRectMake(150, 100, 130, 200)];
    [self.logoImageView setImage:[UIImage imageNamed:@"logo_lagou"]];
    [self.view addSubview:self.logoImageView];
    
    
#pragma  mark -- 切圆角的view
    BottleView *bottleView = [[BottleView alloc] init];
    bottleView.bounds = CGRectMake(18, 350, 380, 102);
    [self.view addSubview:bottleView];
#pragma  mark -- 用户名输入框
    // 手机图片
    self.phoneImageView = [[UIImageView alloc] initWithFrame:CGRectMake(18, 350, 50, 50)];
    self.phoneImageView.backgroundColor = [UIColor blackColor];
    
    [self.phoneImageView setImage:[UIImage imageNamed:@"icon_username"]];
    [bottleView addSubview:self.phoneImageView];
    
    
    // 验证码imageview
    self.verificationCodeImageView = [[UIImageView alloc] initWithFrame:CGRectMake(18, 402, 50, 50)];
    self.verificationCodeImageView.backgroundColor = [UIColor blackColor];
    [self.verificationCodeImageView setImage:[UIImage imageNamed:@"icon_password"]];
    [bottleView addSubview:self.verificationCodeImageView];
    // 手机号输入框
    self.phoneNumeberTextField = [[UITextField alloc] initWithFrame:CGRectMake(68, 350, 330, 50)];
    self.phoneNumeberTextField.placeholder = @"请输入手机号";
    [self.phoneNumeberTextField setValue:[UIColor whiteColor] forKeyPath:@"_placeholderLabel.textColor"];
    self.phoneNumeberTextField.textColor = [UIColor whiteColor];
    self.phoneNumeberTextField.alpha = 0.3;
    self.phoneNumeberTextField.backgroundColor = [UIColor blackColor];
    [bottleView addSubview:self.phoneNumeberTextField];
    // 验证码输入框
    self.verificationCodeTextField = [[UITextField alloc] initWithFrame:CGRectMake(68, 402, 330, 50)];
    self.verificationCodeTextField.alpha = 0.3;
    self.verificationCodeTextField.placeholder = @"请输入验证码";
    self.verificationCodeTextField.textColor = [UIColor whiteColor];
    [self.verificationCodeTextField setValue:[UIColor whiteColor] forKeyPath:@"_placeholderLabel.textColor"];
    self.verificationCodeTextField.backgroundColor = [UIColor blackColor];
    self.verificationCodeTextField.secureTextEntry = YES;
    [bottleView addSubview:self.verificationCodeTextField];
#pragma mark -- 注册代表你已同意拉勾用户协议
#pragma mark -- 注册代表你已同意 标签
    UILabel *mailLabel = [[UILabel alloc]initWithFrame:CGRectMake(82, 455, 145, 30)];
    //mailLabel.backgroundColor = color;
    mailLabel.font = [UIFont systemFontOfSize:18];
    mailLabel.text = @"注册代表你已同意";
    mailLabel.textColor = [UIColor whiteColor];
    [self.view addSubview:mailLabel];
#pragma mark -- 拉勾用户协议 按钮
    UIButton *clickHereButton = [UIButton buttonWithType:UIButtonTypeSystem];
    //clickHereButton.backgroundColor = [UIColor whiteColor];
    clickHereButton.frame = CGRectMake(224, 455, 110, 30);
    [clickHereButton setTitle:@"拉勾用户协议" forState:UIControlStateNormal];
    clickHereButton.font = [UIFont systemFontOfSize:18];
    [clickHereButton setTitleColor:color forState:UIControlStateNormal];
    [self.view addSubview:clickHereButton];
#pragma mark -- 注册的button
    UIButton *loginButton = [[UIButton alloc] initWithFrame:CGRectMake(18, 550, 380, 50)];
    loginButton.backgroundColor = color;
    loginButton.layer.cornerRadius = 5;
    [loginButton maskView];
    [loginButton setTitle:@"注  册" forState:UIControlStateNormal];
    [loginButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [self.view addSubview:loginButton];
    
#pragma mark -- 返回登录
    UIButton *backButton = [UIButton buttonWithType:UIButtonTypeSystem];
    backButton.backgroundColor = [UIColor colorWithRed:0 / 255.0 green:180 / 255.0 blue:140 / 255.0 alpha:0.3];

    backButton.frame = CGRectMake(18, 610, 380, 50);
    [backButton setTitle:@"返回登录" forState:UIControlStateNormal];
    [backButton setTintColor:color];
    
    //backButton.titleLabel.textColor = [UIColor blackColor];
    backButton.layer.cornerRadius = 5;
    backButton.layer.masksToBounds = YES;
    [backButton addTarget:self action:@selector(backLogin:) forControlEvents:UIControlEventTouchUpInside];
 
#pragma mark --- 返回登录的边框
    UIView *backBorderView = [[UIView alloc] initWithFrame:CGRectMake(18, 610, 380, 50)];
    [backBorderView.layer setBorderColor:color.CGColor];
    backBorderView.layer.borderWidth = 2;
    
    backBorderView.layer.cornerRadius = 5;
    backBorderView.backgroundColor = [UIColor clearColor];
    backBorderView.layer.masksToBounds = YES;
    [self.view addSubview:backBorderView];
    [self.view addSubview:backButton];
    
}
- (void)backLogin:(UIButton *)button {
    [self dismissViewControllerAnimated:NO completion:^{
      
    }];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
